Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Replace columnHasNulls with row stats #11841

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zation99
Copy link
Contributor

@zation99 zation99 commented Dec 12, 2024

PR to address #11741

  • Removed the use of columnHasNulls in RowContainer and replaced them with row stats
  • Added updateColumnStats in two more places (batch version of storeWithNulls and storeNoNull)

In the case of erasure, columnStats is invalidated so optimizations for hasNull is turned off.

@zation99 zation99 requested a review from xiaoxmeng December 12, 2024 09:35
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 12, 2024
@zation99 zation99 requested a review from tanjialiang December 12, 2024 09:35
Copy link

netlify bot commented Dec 12, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 08006fc
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/675aae722afa6f0008e49cd7

@zation99 zation99 changed the title Replace columnHasNulls with row stats refactor: Replace columnHasNulls with row stats Dec 12, 2024
@zation99 zation99 changed the title refactor: Replace columnHasNulls with row stats feat: Replace columnHasNulls with row stats Dec 12, 2024
@zation99 zation99 marked this pull request as draft December 12, 2024 22:35
@@ -823,7 +823,8 @@ class RowContainer {

/// Returns true if specified column may have nulls, false otherwise.
inline bool columnHasNulls(int32_t columnIndex) const {
return columnHasNulls_[columnIndex];
return columnStats(columnIndex).has_value() &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/columnHasNulls/columnMayHaveNulls/
!columnStats(columnIndex).has_value() || columnStats(columnIndex)->nullCount() > 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @tanjialiang suggested, I'll separate the nullCount when invalidating columnStats, so that we don't need to check it here.

@@ -567,7 +562,8 @@ void RowContainer::store(
decoded,
rows,
isKey,
offsets_[column]);
offsets_[column],
column);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also change in #11527, FYI.
Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the information. I see it's already merged. Let me rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants